All Questions
19 questions
2votes
2answers
135views
LinkedList Stack Implementation
I'm new to the programming and I want to ask a question about my linkedlist stack implementation if it's correct and if it meets the requirements of the linkedlist stack implementation. If there is ...
0votes
2answers
71views
Another Stack implementation in Java
I'm trying to write my own stack implementation using LinkedList. It looks like it is doing what it should doing. But how does it look from a design perspective? ...
3votes
1answer
759views
Detecting a cycle in a linked list using Java
I'm solving HackerRank "Linked Lists: Detect a Cycle" challenge. A linked list is said to contain a cycle if any node is visited more than once while traversing the list. Complete the ...
4votes
3answers
372views
Linked list node implementation with maximum code reuse
Currently as an exercise to practicing SOLID principles and basic data structures, I am trying to implement linked list type structures with as much code reuse as possible. Currently, I have: ...
4votes
2answers
2kviews
LinkedList implementation with Iterators in Java
I am a newbie to Java. I will be glad to hear your opinion with regards to this LinkedList implementation. The Iterators are self implemented by my decision: ...
1vote
3answers
823views
Doubly linked list in Java
I did not add generics to my code because I am new to Java. I am on my way in learning data structures and algorithms. I just want to make sure that my code is clean and efficient. ...
2votes
1answer
140views
Partition a singly linked list using Java - follow-up
This is a follow up to my last question: Partition a singly linked list using Java Based on the feedback I received there, I changed the following about the code: Added a ...
2votes
2answers
1kviews
Partition a singly linked list using Java
This is my attempted solution to exercise 2.4 in Cracking the Coding Interview. The problem statement is: Write code to partition a linked list around a value x such that all nodes less than x come ...
2votes
1answer
658views
Implementation of Queue using Linkedlist in Java
Can someone please review my code? Is it the correct implementation of a queue? If not, please give suggestions on how to implement it using a linked list. ...
4votes
1answer
75views
How can I enhance my linkedlist implementation in java?
I recently implemented Linked List on my own. I did not use generics as I am still learning. How can I improve it: ...
0votes
1answer
1kviews
Using composition or inheritance to enhance this linked list
Problem Statement: A method called insertEnd() exists, but it runs in linear time, because every time it is called, it walks down the list to find the end. Without changing the meaning of this ...
2votes
1answer
191views
Self-made linked list implementing List<E>
I have to make a linked list as a quasi-homework task, about which I have already asked two questions about here and here. Since the whole code is really big (400 lines approx.), I will include only ...
5votes
3answers
7kviews
Custom linked list implementing Iterable used as stack
I have created a custom linked list that implements the Iterable interface. I am then using this linked list to implement my custom stack. I have also thrown a ...
13votes
2answers
30kviews
Self-made linked list iterator
I recently made a linked list for myself, the code of which was posted here, if anyone would be interested. Now, as the next task, I had to make an Iterator for my ...
18votes
5answers
5kviews
Self-made Linked List
I was tasked by my teacher with making a linked list by myself, so I could understand the concept better. Here is the MyLinkedList class: ...